package com.xgz.processor.factorypost;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

/**
 * bean工厂的后置处理
 * @author xgz
 */
@Component
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor, Ordered {

	public MyBeanFactoryPostProcessor() {
		System.out.println("My BeanFactoryPostProcessor 构造器执行...");
	}

	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		System.out.println(" bean工厂 后置增强 s ");
		System.out.println(beanFactory);
		System.out.println(" bean工厂 后置增强 e ");
	}

	@Override
	public int getOrder() {
		return 88; // 数字越小 优先级越高
	}
}
